#ifndef MP4_CONFIG_H
#define MP4_CONFIG_H

//FIXME: - Mac上临时注释
//typedef long int64_t;
//typedef unsigned long uint64_t;
//typedef unsigned int uint32_t;
//typedef unsigned char uint8_t;

#define UINT32_MAX 0xffffffff
#define INT32_MAX  0x7fffffff
#define H264_LANGUAGE 0x55C4

/*
----mvhd----:
timescale:1000		//一秒分1000份，表时间单位为1毫秒
duration:1556
----tkhd----:
duration:1554		//这个值对播放器很重要, 具体时间还和mvhd的timescale相关,用来指定了时长
----mdhd----:
timescale:24000		//决定了播放速度，不过他与duration的相乘后还是可以对应上面的mvhd设置
duration:37037
----samp----:
entry_count:1
sample_count:37		//上的duration时间，duration指整个mdat中video时长，37却为chunks数目
sample_delta:1001	//1001 * 37=37037 sample_delta*sample_count=duration
*/

/*----mvhd----*/
#define MOV_TIMESCALE (1000)
//#define MOV_MAX_TRACK_DURATION (0)
//timescale:MOV_TIMESCALE
//duration:
//		FPS=MEDIA_TIMESCALE/MEDIA_SAMPLE_DURATION
//		duration=帧数/FPS*MOV_TIMESCALE
//				=帧数*MEDIA_SAMPLE_DURATION*MOV_TIMESCALE/MEDIA_TIMESCALE

/*----tkhd----*/
//duration:
//		FPS=MEDIA_TIMESCALE/MEDIA_SAMPLE_DURATION
//		duration=帧数/FPS*MOV_TIMESCALE
//				=帧数*MEDIA_SAMPLE_DURATION*MOV_TIMESCALE/MEDIA_TIMESCALE

#define MOV_TIMESCALE_TO_MEDIA_TIMESCALE (30)
/*----mdhd----*/
#define MEDIA_TIMESCALE2 (MOV_TIMESCALE*MOV_TIMESCALE_TO_MEDIA_TIMESCALE)	//使用在mdhd中
//timescale:MEDIA_TIMESCALE
//duration:MEDIA_SAMPLE_DURATION*帧数

/*----sample----*/
//#define MEDIA_SAMPLE_DURATION (1001)
//unsigned int MEDIA_SAMPLE_DURATION=1001;			该数值放在Mp4中便于多路互不影响
//entry_count:1
//sample_count:帧数
//sample_delta:MEDIA_SAMPLE_DURATION

//如上可得:
//MOV_TIMESCALE 及 MEDIA_SAMPLE_DURATION 为定值,不影响播放
//MEDIA_TIMESCALE/MEDIA_SAMPLE_DURATION 决定了 FPS:29.9帧率

#endif /* MP4_CONFIG_H */
